<tpl> include file='sys_config.head.html' </tpl>
<div id="doc3">
	<div id="yui-main">
		<div class="yui-g">
 			<div id="divinbox">
				<div class="gtlbar">
					<div class="gtlbar-left">员工管理 &gt;&gt; 添加员工</div>
				</div>
				<!--<div class="c-s-1">
				    <ul>
				        <li class="wo-1"><a href="">基本信息</a></li>
				        <li class="wo-1"><a href="system_power.manage.php?action=add_fl">福利待遇</a></li>
				        <li class="wo-1"><a href="system_power.manage.php?action=add_offer">入职信息</a></li>
				    </ul>
				</div>-->
				<div class="ctge">
					<div class="ctge-1">
						<form id="form_add" action="member.manage.php" method="post" enctype="multipart/form-data">
						<input type="hidden" name="action" value="save_member" />
						<div class="ctge-1-1">
							<table cellSpacing="0" cellPadding="0" class="fct" border="0">
								<tr>
								    <td colspan="2">基本信息</td>
								</tr>
							     <!--<tr>
							         <th>部门</th>
							         <td>
							             <input name="department" value="" type="hidden">
							             <input type="text" name="department_text" id="department_text" value="" />
							             <span><input class="bthl" id="department_manage" type="button" name="department" value="管理部门"></span>
							         </td>
							         
							     </tr>-->
							    <tr>
							         <th>所属部门</th>
							         <td>
							             <select name="department" id="department">
							             <tpl> section name=loop loop=$department_list </tpl>
							             	<option value="<tpl> $department_list[loop].id </tpl>"><tpl> $department_list[loop].name </tpl></option>
							             <tpl> /section </tpl>
							             </select>
							         </td>
							     </tr>
								<tr>
									<th>用户名:</th>
									<td>
									<span class="dptn">帐号5-20位</span>
									<input class="fct-input" name="sys_login_name" id="sys_login_name" value="" type="text" maxlength="18" /></td>
								</tr>
								<tr>
									<th>真实姓名:</th>
									<td>
									<span class="dptn">姓名2-20位</span>
									<input class="fct-input" name="real_name" id="real_name" value="" type="text" maxlength="18" /></td>
								</tr>
								<tr>
									<th>密码:</th>
									<td>
									<span class="dptn">密码5-16位 </span>
									<input class="fct-input" name="sys_password" id="sys_password" type="password" maxlength="16" /></td>
								</tr>
								<tr>
									<th>再次输入密码:</th>
									<td>
										<input class="fct-input" name="sys_password_two" id="sys_password_two" type="password" maxlength="16" />
									</td>
								</tr>
								<tr>
								    <th>照片：</th>
								    <td>
								        <input type="file" name="pic">
								    </td>
								</tr>
								<tr>
								    <th>性别：</th>
								    <td>
								        <input type="radio" name="gender" value="1" checked>男
								        <input type="radio" name="gender" value="0">女
								    </td>
								</tr>
								<tr>
								    <th>出生年月：</th>
								    <td>
								        <input class="fct-input" readonly="true"  name="txtBirthday" id="txtBirthday" type="text" />
								    </td>
								</tr>
								<tr>
									<th>Email:</th>
									<td>
									<input class="fct-input" name="sys_email" id="sys_email" type="text" maxlength="30" /></td>
								</tr>
								<tr>
									<th>角色:</th>
									<td>
										<select name="sys_group_id">
										<tpl> section name=loop loop=$sys_group_list </tpl>
											<option value="<tpl> $sys_group_list[loop].sys_group_id </tpl>"><tpl> $sys_group_list[loop].sys_group_name </tpl></option>
										<tpl> /section </tpl>
										</select>
									</td>
								</tr>
								<tr>
								    <td colspan="2">扩展信息</td>
								</tr>
								<tr>
									<th>工资:</th>
									<td><input class="fct-input" name="gongzi" id="gongzi" type="text" maxlength="100" /></td>
								</tr>
								<tr>
									<th>入职时间:</th>
									<td><input class="fct-input" readonly="true" name="in_time" id="in_time" type="text" /></td>
	                            </tr>
	                            <tr>
	                                <th>离职时间</th>
	                                <td><input class="fct-input" readonly="true" name="out_time" id="out_time" type="text" /></td>
	                            </tr>
							</table>
						</div>
						<div class="bth-ct">
						<div class="bth-pl">
							<input class="bthl" value="保存" type="submit" />
							<input type="button" class="bthl" value="返回" onclick='history.back();'/>
						</div>
					</div>
					</form>
					</div>
				</div>	
			</div>
		</div>
	</div>
</div>
<div id="module_block" style="display:none; width:800px; height:460px; margin:0; padding:0;"></div> 
<tpl> include file='sys_config.js.html' </tpl>
<link href="<tpl> $site_url </tpl>/js/jquery/ui.theme.css" rel="stylesheet" type="text/css" />
<script src="<tpl> $site_url </tpl>/js/jquery/ui.datepicker.js"></script>
<script src="<tpl> $site_url </tpl>/js/jquery/jquery.blockUI.js"></script>
<script>
var module_block = $('#module_block')[0];
$(document).ready(function(){
    $('#txtBirthday').datepicker({
		dateFormat:'yy-mm-dd',
		changeMonth: true,
		changeYear: true
	});
    $('#in_time').datepicker({
		dateFormat:'yy-mm-dd',
		changeMonth: true,
		changeYear: true
	});
    $('#out_time').datepicker({
    	dateFormat:'yy-mm-dd',
    	changeMonth: true,
    	changeYear: true
    });
//    $('#department_manage').click(function(){
//    	$.blockUI(module_block, { width: '800px', height:'460px',top:'80px', left:'20%' });
//    	$('#module_block').html("<br />选择部门:"+
//    	"<div id='department_list'>"+
//		"<tpl>section name=loop loop=$department_list</tpl>"+
//		"<tpl>$department_list[loop].name</tpl>-------"+
//		"<a href='javascript:deleteRow(this);select_department(<tpl>$department_list[loop].id</tpl>,\"<tpl>$department_list[loop].name</tpl>\");'>选择</a>"+
//		"<br /><tpl>/section</tpl></div>"+
//		"<div><table cellspacing='0' cellpadding='0' border='0' class='fct-1'><tbody><tr><th>添加部门:</th><td><input id='department_name' type='text' name='name' /></td><td><input type='submit' onclick='javascript:deleteRow(this);submit_department();' class='bthl' value='添加'></td></tr></tbody></table></div>"
//		);
//		$("#department_manage").attr("disabled","disabled");
//
//    });
});
$("#form_add").validate({
	errorClass: "wrong",
	rules: {
		sys_login_name: {required:true,minlength:2},
		sys_password: {required:true,minlength:5,maxlength:16},
		sys_password_two: {required:true,minlength:5,maxlength:16,equalTo:'#sys_password'},
		sys_email: {required:true,email:true}
	},
	messages: {
		sys_login_name: {required: "请填写员工姓名",minlength:"姓名至少俩个字符"},
		sys_password: {required: "请填写密码",minlength:"密码至少5个字符",maxlength:"密码不能超过16个字符"},
		sys_password_two: {required: "请确认密码",minlength:"密码至少5个字符",maxlength:"密码不能超过16个字符",equalTo:"俩次密码输入不同"},
		sys_email: {required:"email地址不能为空",email:"email格式错误"}
	}
});
//function select_department(id,name)
//{
//	$('#department').val(id);
//	$('#department_text').val(name);
//}
//function submit_department()
//{
//	name = $('#department_name').val();
//	$.ajax({
//		url:"system_power.manage.php",
//		data: "action=save_department&sys_department_name="+name+"&parent_id=0",
//		type:"post",
//		dataType:"html",
//		success: function (){
//			alert('添加成功');
//		},
//		error: function (){
//			alert('添加失败');
//		}
//	});
//}
//function deleteRow(elem) {
//	
//	$.unblockUI();
//	
//	var row = $(elem).parent().parent();
//	
//	row.fadeOut('normal', function() {row.remove();});
//	
//	$("#department_manage").attr("disabled","");
//}
</script>
</body>
</html>
